<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="css/demo.css">
</head>

<body>
    <script>
        /* 初次进入页面就设置html的font-size */
        var width = document.documentElement.offsetWidth;
        var fontSize = width / 6.4;
        document.documentElement.style.fontSize = fontSize + "px";

/* 屏幕尺寸发生改变就设置 html的font-size */
        window.onresize = function () {
            width = document.documentElement.offsetWidth;
            fontSize = width / 6.4;
            document.documentElement.style.fontSize = fontSize + "px";
        }
    </script>

    <div>

    </div>
</body>

</html>